|
|
|
|
|
|
|
Learn to declare and manipulate arrays |
|
|
|
|
|
|
|
|
Learn about user-defined data types |
|
|
|
|
|
|
|
|
Learn about the built-in constants and user-defined constants |
|
|
|
|
|
|
|
|
Learn about the different mathematical operators |
|
|
|
|
|
|
|
|
Sample Project File: \Chapter07\ArraysTypes.vbp |
|
|
|
|
|
|
|
|
An array is a group of common elements accessed under a common name. Each element is referenced with a number, called an index. Array elements start with zero in Visual Basic (see Figure 7.1). |
|
|
|
|
|
|
|
|
Figure 7.1
An array example. |
|
|
|
|
|
|
|
|
Arrays have the following characteristics: |
|
|
|
|
|
|
|
|
Arrays elements start with the number zero (0). |
|
|
|
|
|
|
|
|
All elements of the array must have the same data type. |
|
|
|
|
|
|
|
|
A variant array may have different data types in each element. |
|
|
|
|
|
|
|
|
Arrays may be public, module level (Private/Dim), or local in scope. |
|
|
|
|
|
|
|
|
Arrays may be a fixed size or dynamically allocated at runtime. |
|
|
|
|
|
|
|
|
The examples for using arrays are located in Arrays.frm. Lets look at the different examples for this form. |
|
|
|
|
|